<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddSendtimeToVulsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('vuls', function (Blueprint $table) {
            $table->timestamp('check_at')->nullable()->comment('审核通过邮件发送时间');
            $table->timestamp('shut_at')->nullable()->comment('关闭发送时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        if (Schema::hasColumn('vuls', 'check_at')){
            Schema::table('vuls', function (Blueprint $table) {
                $table->dropColumn('check_at');
            });
        }
        if (Schema::hasColumn('vuls', 'shut_at')){
            Schema::table('vuls', function (Blueprint $table) {
                $table->dropColumn('shut_at');
            });
        }
    }
}
